package com.gec.zhs.controller;

import java.util.List;

import com.gec.zhs.entity.query.WmsinboundordertblQuery;
import com.gec.zhs.entity.po.Wmsinboundordertbl;
import com.gec.zhs.entity.vo.ResponseVO;
import com.gec.zhs.service.WmsinboundordertblService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 入库通知单（入库订单） Controller
 */
@RestController("wmsinboundordertblController")
@RequestMapping("/wmsinboundordertbl")
public class WmsinboundordertblController extends ABaseController{

	@Resource
	private WmsinboundordertblService wmsinboundordertblService;
	/**
	 * 根据条件分页查询
	 */
	@RequestMapping("/loadDataList")
	public ResponseVO loadDataList(WmsinboundordertblQuery query){
		return getSuccessResponseVO(wmsinboundordertblService.findListByPage(query));
	}

	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVO add(Wmsinboundordertbl bean) {
		wmsinboundordertblService.add(bean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVO addBatch(@RequestBody List<Wmsinboundordertbl> listBean) {
		wmsinboundordertblService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增/修改
	 */
	@RequestMapping("/addOrUpdateBatch")
	public ResponseVO addOrUpdateBatch(@RequestBody List<Wmsinboundordertbl> listBean) {
		wmsinboundordertblService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id查询对象
	 */
	@RequestMapping("/getWmsinboundordertblById")
	public ResponseVO getWmsinboundordertblById(String id) {
		return getSuccessResponseVO(wmsinboundordertblService.getWmsinboundordertblById(id));
	}

	/**
	 * 根据Id修改对象
	 */
	@RequestMapping("/updateWmsinboundordertblById")
	public ResponseVO updateWmsinboundordertblById(Wmsinboundordertbl bean,String id) {
		wmsinboundordertblService.updateWmsinboundordertblById(bean,id);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id删除
	 */
	@RequestMapping("/deleteWmsinboundordertblById")
	public ResponseVO deleteWmsinboundordertblById(String id) {
		wmsinboundordertblService.deleteWmsinboundordertblById(id);
		return getSuccessResponseVO(null);
	}
}